package org.kzwl.book;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.kzwl.comm.advice.CommonControllerAdvice;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScans;
import org.springframework.context.annotation.Import;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;

/**
 * 启动类
 */
@ServletComponentScan
@ComponentScan("org.kzwl.service")
@ComponentScan("org.kzwl.book.controller")
@MapperScan("org.kzwl.mapper")
@Import(CommonControllerAdvice.class)
//取消security自带登录页面
@SpringBootApplication(exclude = {SecurityAutoConfiguration.class})
public class ReadBookStart {

    @Bean
    public PaginationInterceptor paginationInterceptor() {
        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
        paginationInterceptor.setOverflow(false);
        return paginationInterceptor;
    }

    public static void main(String[] args) {
        SpringApplication.run(ReadBookStart.class,args);

    }

}
